global keepers1968 ""

numlabel, add

genl yr=1968
global keepers1968 $keepers1968 yr

genl id=v2
global keepers1968 $keepers1968 id

genl income=v23
genl income3=income
centile income, c(33 66 100)
replace income3=0 if income<=r(c_1)
centile income, c(33 66 100)
replace income3=1 if income>r(c_1) & income<=r(c_2)
centile income, c(33 66 100)
replace income3=2 if income>r(c_2) & income<=r(c_3)
global keepers1968 $keepers1968 income3

genl pid_ce=(v311==2 & v312==1)
replace pid_ce=. if v310==.
global keepers1968 $keepers1968 pid_ce

genl pid_gov=pid_ce
global keepers1968 $keepers1968 pid_gov

genl vote_ce=v431
recode vote_ce 2=1 .=. else=0
global keepers1968 $keepers1968 vote_ce

genl vote_gov=vote_ce
global keepers1968 $keepers1968 vote_gov


genl gpi=v61
recode gpi 8=2.5
replace gpi=abs(gpi-4)/3
global keepers1968 $keepers1968 gpi

genl socref=v131
recode socref 8=3
replace socref=(socref-1)/4
global keepers1968 $keepers1968 socref

genl degree=v460
recode degree 50=1 11/43 51=0
global keepers1968 $keepers1968 degree


// Class/occupation

gen class_resp_3cat = v451
recode class_resp_3cat 1/7=3 10/25=2 30/40=1
label variable class_resp_3cat "Social class (3 cats.): higher value is higher class"
*label define LblClassGrade 1 "A: (Higher man.; prof." 2 "B: Lower man.; admin." 3 "C1A: Skilled; supervis. non-manu." 4 "C1B: Lower non-manu." 5 "C2: Skilled manu." 6 "D: Unskilled manu."
*label values class_head_grade LblClassGrade
global keepers1968 $keepers1968 class_resp_3cat

gen class_husb_3cat = v65
recode class_husb_3cat 1/7=3 10/25=2 30/40=1 77=.
label variable class_husb_3cat "Social class (3 cats.): higher value is higher class"
*label define LblClassGrade 1 "A: (Higher man.; prof." 2 "B: Lower man.; admin." 3 "C1A: Skilled; supervis. non-manu." 4 "C1B: Lower non-manu." 5 "C2: Skilled manu." 6 "D: Unskilled manu."
*label values class_head_grade LblClassGrade
global keepers1968 $keepers1968 class_husb_3cat

gen male = v16
recode male 1=1 2=0
global keepers1968 $keepers1968 male

gen married = v17
recode married 1=1 2=0 3=0 4=0
global keepers1968 $keepers1968 married

gen unionmem_resp = v458
recode unionmem_resp 1/4=1 8=0 0=0
global keepers1968 $keepers1968 unionmem_resp



// Pascal/SM moderators

 gen party_ID=v311 if v310==1
 tab party_ID, m
 tab party_ID v311, m
 lab def party_ID 1 "v�nsterpartiet kom " 2 "socialdemokraterna" 3"centerpartiet" 4"folkpartiet" 5"h�gerpartiet" 6"kristen demokratis" 7 "other" 8 "will not answer"9 " kommunistiska f�rbundet marxist-len" 10 " moderata samlingspartiet " 11 "sveriges kommunis" 12 "borgerligt "  13 "FC+C" 14 "lokal borgerlig" 15 "sk�nepartiet" 16 "kommunistiska arbetaref�rbundet" 17 "vpk, apk, kpmlr, skp, kaf" 18 "gr�nt parti" 19 "ny demokrati"
 lab val party_ID party_ID
 
 foreach var of varlist v123  v125  v127  v129 {
        gen Z`var'=`var'
		replace Z`var'=1 if `var'==1
		replace Z`var'=2 if `var'==2
		replace Z`var'=2.5 if `var'==8
		replace Z`var'=3 if `var'==4
		replace Z`var'=4 if `var'==5
		replace Z`var'=(Z`var'-1)/3
		tab Z`var' `var', m
  }
  
  
  rename Zv123 state_inefficiency
  lab var  state_inefficiency "1=State CANNOT run an enterprise as well as the private"
  rename Zv125 no_welfare
  lab var no_welfare "1=all should have to take care of themself without welfare"
  
  rename Zv127 tomuch_equality
  lab var tomuch_equality "1=equality has gone to far"
  rename Zv129 no_state
  lab var no_state "1=enterprise perform better without state intervention"
  
  
   foreach var of varlist  v124  v126  v128 v130{
        gen Z`var'=`var'
		replace Z`var'=1 if `var'==5
		replace Z`var'=2 if `var'==4
		replace Z`var'=2.5 if `var'==8
		replace Z`var'=3 if `var'==2
		replace Z`var'=4 if `var'==1
		replace Z`var'=(Z`var'-1)/3
		tab Z`var' `var', m
  }
  
  

  
  rename Zv124 state_employment
  lab var state_employment "1=state intervention reduce unemployment risk"
  
   rename Zv126 econ_control
  lab var  econ_control "1=agree state control limit bank and industry influence"
  
  rename Zv128 social_reform
  lab var social_reform "1=agree that more social reform are needed"
  
  rename Zv130 group_equality
  lab var group_equality "1=agree with group equality"
  
  gen bank_gov_appointies=.
  replace bank_gov_appointies=1 if v144==1
   replace bank_gov_appointies=.66 if v144==2
  replace bank_gov_appointies=.33 if v144==3
  replace bank_gov_appointies=0 if v144==5
  tab bank_gov_appointies v144, m
  
    lab var bank_gov_appointies "1=agree government appointes on bank and enterprises board"
	
	
  gen right=.
  replace right=0.5 if v320==88 | v320==0
  replace right=((v320+50)/100) if v319==5 & (v320~=88 & v320~=0)
  replace right=1 if v320==52 & v319==5 
   
replace right=(50-v320)/100 if v319==1 & (v320~=88 & v320~=0 & v320~=52)
replace right=0 if v320==52 & v319==1 


  tab right, m
  lab var right "1=far right"

   ***********PROBLEM TRANSLATION
   foreach var of varlist  v399- v415{
        gen Z`var'=`var'
		
		//tab Z`var' `var', m
  }
  
  *********************************
 
  
 gen imp_winner=.
 replace imp_winner=1 if v62==1
 replace imp_winner=0.5 if v62==3 | v62==8
 replace imp_winner=0 if v62==5
 tab v62 imp_winner, m
 
 lab var imp_winner "1=which party win the election is important"
  

  gen talk_politic_family=.
 replace talk_politic_family=1 if v416==1
 replace talk_politic_family=0.5 if v416==3 | v416==8
 replace talk_politic_family=0 if v416==5
 replace talk_politic_family=. if v416==6
 tab v416 talk_politic_family, m
 
 lab var talk_politic_family "1=often talk politic with family" 
  
  
   gen talk_politic_outfamily=.
 replace talk_politic_outfamily=1 if v417==1
 replace talk_politic_outfamily=0.5 if v417==3 | v417==8
 replace talk_politic_outfamily=0 if v417==5
 tab v417 talk_politic_outfamily, m
 
 lab var talk_politic_outfamily "1=often talk politic outside family" 

 
 gen newspaper_politics=.
 replace newspaper_politics=1 if v34==1
 replace newspaper_politics=0.66 if v34==2
 replace newspaper_politics=0.33 if v34==3
 replace newspaper_politics=0 if v34==4
	
 
 tab v34 newspaper_politics, m
 lab var newspaper_politics "1=read more politic articles"
 
 gen read_magazine=1 if v25==1
 replace read_magazine=0 if v25==5
 tab read_magazine v25, m
 lab var read_magazine "1=readmagazine that discuss politic"

 
 gen anti_state_inefficiency=.
replace anti_state_inefficiency=0.3333333 if state_inefficiency>0.5 & state_inefficiency<1
replace anti_state_inefficiency=0.6666666 if state_inefficiency>0 & state_inefficiency<0.5
replace anti_state_inefficiency=1 if state_inefficiency==0
replace anti_state_inefficiency=0.5 if state_inefficiency==0.5
replace anti_state_inefficiency=0 if state_inefficiency==1
tab anti_state_inefficiency state_inefficiency, m

gen anti_no_state=.
replace anti_no_state=0.3333333 if no_state>0.5 & no_state<1
replace anti_no_state=0.6666666 if no_state>0 & no_state<0.5
replace anti_no_state=1 if no_state==0
replace anti_no_state=0.5 if no_state==0.5
replace anti_no_state=0 if no_state==1
tab anti_no_state no_state, m

gen anti_econ_control=.
replace anti_econ_control=0.3333333 if econ_control>0.5 & econ_control<1
replace anti_econ_control=0.6666666 if econ_control>0 & econ_control<0.5
replace anti_econ_control=1 if econ_control==0
replace anti_econ_control=0.5 if econ_control==0.5
replace anti_econ_control=0 if econ_control==1
tab anti_econ_control econ_control, m

gen anti_state_employment=.
replace anti_state_employment=0.3333333 if state_employment>0.5 & state_employment<1
replace anti_state_employment=0.6666666 if state_employment>0 & state_employment<0.5
replace anti_state_employment=1 if state_employment==0
replace anti_state_employment=0.5 if state_employment==0.5
replace anti_state_employment=0 if state_employment==1
tab anti_state_employment state_employment, m

gen anti_bank_gov_appointies=.
replace anti_bank_gov_appointies=0.3333333 if bank_gov_appointies>0.5 & bank_gov_appointies<1
replace anti_bank_gov_appointies=0.6666666 if bank_gov_appointies>0 & bank_gov_appointies<0.5
replace anti_bank_gov_appointies=1 if bank_gov_appointies==0
replace anti_bank_gov_appointies=0.5 if bank_gov_appointies==0.5
replace anti_bank_gov_appointies=0 if bank_gov_appointies==1
tab anti_bank_gov_appointies bank_gov_appointies, m

gen index_interest=( gpi+ talk_politic_family+ talk_politic_outfamily +newspaper_politics  )/4
global keepers1968 $keepers1968 index_interest

gen index_market_oriented=(socref+  state_inefficiency +no_state +anti_econ_control+ anti_state_employment +anti_bank_gov_appointies +right)/7
global keepers1968 $keepers1968 index_market_oriented
